import BorderlessButton from '@/src/components/borderless-button'
// import { View, Text, Image } from '@tarojs/components'
import List from "./list"


// import Global from '@/src/lib/global'
import GoodsCartModel from '@/src/lib/models/goods_cart_model'
// import Taro from '@tarojs/taro'

import "./goods-list.scss"

interface GoodsListProps {
    models?: GoodsCartModel[],
    discountTip: string,
    isExistDiscount: boolean,
    isShowPickBtn: boolean,
    onGetCouponBtnClick: () => void
}


const GoodsList = (props: GoodsListProps) => {

    // let onPickBtnClick = () => {
    //     Taro.switchTab({url: "/pages/home/index"})
    // }

    let getCouponBtn = <BorderlessButton backgroundImage="btn_get_coupon@3x.png" style={{ width: "165rpx", height: "37rpx", backgroundColor: "transparent", marginTop: "10rpx"}} onClick={ props.onGetCouponBtnClick }/>
    // let getCouponBtn = null
    

    // let footer = (
    //     <View className="sale">
    //         <View>
    //             <Text className="sale-title">优惠</Text>
    //             <Text className="sale-desc" style={{ color: props.isExistDiscount ? "#FF4C47" : "#444444"}}>{ props.discountTip }</Text>
    //         </View>
    //         {
    //             props.isShowPickBtn ? (
    //                 <View className="sale-indicator-btn" onClick={ onPickBtnClick }>
    //                     <Text>去凑单</Text>
    //                     <Image src={ Global.loadImage("icon_arrow_right@3x.png") }/>
    //                 </View>
    //             ) : null
    //         }
    //     </View>
    // )

    return (
        // <List title=" " titleRightEl={getCouponBtn}  footer={ footer } models={ props.models } />
        <List title=" " titleRightEl={getCouponBtn}   models={ props.models } /> //改
    )
}
export default GoodsList